<template>
	<view class="bill-c">
		<view class="syspadding navbar">
			<view class="navbarh acea-row row-between-wrapper">
				<view class="acea-row row-middle backbtn" @click="back">
					<image class="back" src="../../static/images/back.png" mode="aspectFit"></image>
					<text style="margin-left: -10rpx;">返回</text>
				</view>
				<view class="fs-34">收入纳税明细查询</view>
				<view class="backbtn"></view>
			</view>
		</view>
		<view style="width: 100%;height: 180rpx;"></view>
		
		<view class="content">
			<view class="acea-row row-middle item">
				<view class="line"></view>
				<view class="bold">请选择纳税记录年度</view>
			</view>
			<view class="item">
				<picker style="width: 100%;" @change="bindPickerChange" :value="index" :range="array">
					<view class="acea-row row-between-wrapper">
						<view>年度</view>
						<view style="width: 300rpx;">{{array[index]}}</view>
						<view class="iconfont icon-xiangyou fc-888 fs-24"></view>
					</view>
				</picker>
			</view>
		</view>
		
		<view class="content">
			<view class="acea-row row-middle item">
				<view class="line"></view>
				<view class="bold">请选择所得类型</view>
			</view>
			<checkbox-group @change="checkboxChange">
				<view class="sel acea-row row-middle">
					<checkbox value="1" checked="true"/>
					<view class="title">工资薪资</view>
				</view>
				<view class="sel acea-row row-middle">
					<checkbox value="2" checked="true"/>
					<view class="title">劳务报酬</view>
				</view>
				<view class="sel acea-row row-middle">
					<checkbox value="3" checked="true"/>
					<view class="title">稿酬</view>
				</view>
				<view class="sel acea-row row-middle">
					<checkbox value="4" checked="true"/>
					<view class="title">特许权使用费</view>
				</view>
			</checkbox-group>	
		</view>
		
		<view class="chaxun" @click="chaxunbtn">查询</view>
		
	</view>
</template>

<script>
	import {
		getyears
	} from '@/api/user.js'
	export default {
		data() {
			return {
				index:0,
				array:[],
				group_year_id:'',
				list:[],
			};
		},
		mounted(){
			this.getyear()
		},
		methods:{
			getyear(){
				let that = this;
				getyears().then(res=>{
					let list = res.data.data;
					that.list = list;
					for(let i in list){
						that.array.push(list[i].year)
					}
					that.index = list.length-1;
					that.group_year_id = list[list.length-1].group_year_id;
				})
			},
			chaxunbtn(){
				let that = this;
				uni.navigateTo({
					url:'/pages/index/bill_list?id='+this.group_year_id
				})
				
			},
			checkboxChange(e){
				let that = this;
				let value = e.detail.value;
				console.log(value)
			},
			bindPickerChange: function(e) {
				this.index = e.detail.value
				this.group_year_id = this.list[this.index].group_year_id;
			},
			back(){
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss">
	.bill-c{
		
		.chaxun{
			width: 690rpx;
			line-height: 88rpx;
			text-align: center;
			color: #fff;
			background-color: #5186E6;
			border-radius: 10rpx;
			margin: 60rpx auto;
		}
		
		.content{
			width: 100%;
			margin-top: 30rpx;
			background-color: #ffffff;
			
			.sel{
				width: 720rpx;
				padding: 30rpx 30rpx 30rpx 0;
				border-bottom: 1rpx solid #f2f2f2;
				margin-left: 30rpx;
				
				.title{
					font-size: 30rpx;
					margin-left: 40rpx;
				}
			}
			
			.item{
				padding: 30rpx;
				border-bottom: 1rpx solid #f2f2f2;
				.line{
					width: 10rpx;
					height: 30rpx;
					border-radius: 10rpx;
					background-color: #5186E6;
					margin-right: 10rpx;
				}
			}
			
		}
		
		.navbar{
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			width: 100vw;
			background-color: #ffffff;
			
			.navbarh{
				width: 100%;
				height: 100rpx;
				padding: 0 30rpx;
				
				.backbtn{
					color: #5186E6;
					width: 150rpx;
				}
				.back{
					width: 60rpx;
					height: 60rpx;
					margin-left: -20rpx;
				}
			}
		}
		
	}
</style>
